Defines TaggableCLArray - #111
Conversation
1b97811 to
a5a22b1
Compare
a5a22b1 to
cb7eaee
Compare
cb7eaee to
7e27d1b
Compare
db03d5f to
3e9fa62
Compare
3e9fa62 to
09c3ad3
Compare
inducer
left a comment
There was a problem hiding this comment.
Thanks! Some thoughts from a first scroll below.
|
Unsubscribing... @-mention or request review once it's ready for a look or needs attention. |
295f82d to
97cbed9
Compare
|
Tests should pass once inducer/pyopencl#531 (or something equivalent) lands. |
|
Any chance this works with Maybe worth adding to the CI? |
🤢 Thanks, added a CI here: kaushikcfd/pytential#1. Will see if anything "interesting" pops up. |
|
@alexfikl: Thanks for catching that.
There are quite a few failures in Probably not a smart thing to require this type. So there are a couple of options I can do here:
|
Not bad! 🚀
I imagine it would be quite a bit of work to get Would it be possible to just have the |
97cbed9 to
f4d1eb4
Compare
Ah, thanks! Yep, I'll just go with not requiring |
d26faf5 to
9f4f766
Compare
Yep, doing that seems to fix the CIs in pytential as well! (Thanks!) This PR is ready for review. |
c78083c to
3355f1c
Compare
inducer
left a comment
There was a problem hiding this comment.
Thanks! Good to go after these fixes.
| tags=tags, axes=axes) | ||
| else: | ||
| new_with_queue = super().copy(queue=queue) | ||
| return self.__class__(None, new_with_queue.shape, |
There was a problem hiding this comment.
Is the code duplication of the two constructor calls here avoidable? (Maybe by setting a base_instance variable?)
There was a problem hiding this comment.
Indeed, using base_instance was helpful.
| return TaggableCLArray(None, ary.shape, | ||
| ary.dtype, | ||
| allocator=ary.allocator, | ||
| strides=ary.strides, | ||
| data=ary.base_data, | ||
| offset=ary.offset, | ||
| events=ary.events, _fast=True, | ||
| _context=ary.context, | ||
| _queue=ary.queue, _size=ary.size, | ||
| axes=axes, | ||
| tags=tags) |
There was a problem hiding this comment.
I don't love the idea of hardcoding so much of the internal structure of cla.Array here. Is there a copy method in Array that we could use instead?
There was a problem hiding this comment.
Not quite, see cla.Array.copy. But tried to avoid the duplication by invoking TaggableCLArray.copy. So there's only one source location where we rely on the structure on cl.array.Array.__init__'s signature.
dc5c01b to
f273e3d
Compare
inducer
left a comment
There was a problem hiding this comment.
Thanks! LGTM once these few concerns are addressed.
Co-authored-by: Andreas Klöckner <inform@tiker.net>
f273e3d to
b8631d3
Compare
|
LGTM, thanks! |
pt.Array's axes taggable types pytato#170requirements.txt.